#include "Iterators.h"

//-----------------------------------------------------------------

template<class E>
Iterator_List<E>::Iterator_List(typename std::list<E>::iterator begin,
                                typename std::list<E>::iterator end) {
    this->begin = begin;
    this->end = end;
    next = begin;
}

template<class E>
bool Iterator_List<E>::has_next() {
    return next != end;
}

template<class E>
E Iterator_List<E>::get_next() {
    return *next++;
}

//-----------------------------------------------------------------

template<class E>
Iterator_Vector<E>::Iterator_Vector(typename std::vector<E>::iterator begin,
                                    typename std::vector<E>::iterator end) {
    this->begin = begin;
    this->end = end;
    next = begin;
}

template<class E>
bool Iterator_Vector<E>::has_next() {
    return next != end;
}

template<class E>
E Iterator_Vector<E>::get_next() {
    return *next++;
}

//-----------------------------------------------------------------

template<class E>
Iterator_Set<E>::Iterator_Set(typename std::set<E>::iterator begin,
                              typename std::set<E>::iterator end) {
    this->begin = begin;
    this->end = end;
    next = begin;
}

template<class E>
bool Iterator_Set<E>::has_next() {
    return next != end;
}

template<class E>
E Iterator_Set<E>::get_next() {
    return *next++;
}

//-----------------------------------------------------------------

template<class E>
Iterator_Hash<E>::Iterator_Hash(typename std::unordered_map<E,int>::iterator begin,
                                typename std::unordered_map<E,int>::iterator end) {
    this->begin = begin;
    this->end = end;
    next = begin;
}

template<class E>
bool Iterator_Hash<E>::has_next() {
    return next != end;
}

template<class E>
E Iterator_Hash<E>::get_next() {
    return (next++)->first;
}

